package Chapter03;

public class Question6 {
    //编写程序 输出满足1+2+3+4+...+n<8888的最大正整数n
    public static void main(String[] args) {
        int n = findMaxInteger();
        System.out.println("满足条件的最大整数: " + n);
    }
    private static int findMaxInteger() {
        int n = 1;
        long sum = 0;
        while (sum < 8888) {
            sum += n;
            n++;
        }
        return n - 2;
    }

}
